<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>地址</title>
<link rel="stylesheet" type="text/css"
	href="<%=basePath%>views/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css"
	href="<%=basePath%>views/css/font-awesome.min.css" />
<link rel="stylesheet" type="text/css"
	href="<%=basePath%>views/css/main.css" />
<link rel="stylesheet" type="text/css"
	href="<%=basePath%>views/css/shop.css" />
<link rel="stylesheet" type="text/css"
	href="<%=basePath%>views/css/square/red.css" />
<link rel="stylesheet" type="text/css"
	href="<%=basePath%>views/css/user.css" />
<script type="text/javascript"
	src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
</head>
<body>
	<!--添加地址b -->
	<div id="divAddressAdd" style="display: block;"
		data-toggle="distpicker">
		<div class="edit_add">
			<form id="address_form" class="form-inline"
				action="<%=basePath%>mobile/address_insertOrUpdate">
				<ul style="padding-top: .6em;">
					<li style="margin-top: 0px;"><span class="left_tit"><span
							class="red pr5">*</span>收货人</span> <span class="right_text"> <input
							type="text" value="" class="form-control custName" id="custName"
							name="custName" placeholder="姓名" data-role="none">
					</span></li>
					<li><span class="left_tit"><span class="red pr5">*</span>手机号码</span>
						<span class="right_text"> <input type="text" value=""
							class="form-control mobile" id="mobile" name="mobile"
							placeholder="手机号码" data-role="none">
					</span></li>
					<li><span class="left_tit"><span class="red pr5">*</span>省份</span>
						<div class="right_text">
							<div class="right_select">
								<select class="form-control" id="province1"></select> <span
									class="bg_span"></span>
							</div>
						</div></li>
					<li><span class="left_tit"><span class="red pr5">*</span>城市</span>
						<div class="right_text">
							<div class="right_select">
								<select class="form-control" id="city1"></select>
								<!-- <select
									class="form-control" id="cmbCity" name="cmbCity"></select> -->
								<span class="bg_span"></span>
							</div>
						</div></li>
					<li><span class="left_tit">区县</span>
						<div class="right_text">
							<div class="right_select">
								<select class="form-control" id="district1"></select>
								<!-- <select
									class="form-control" id="cmbArea" name="cmbArea"></select>  -->
								<span class="bg_span"></span>
							</div>
						</div></li>
					<!-- <div class="form-group">
						<label class="sr-only" for="province1">Province</label> <select
							class="form-control" id="province1"></select>
					</div>
					<div class="form-group">
						<label class="sr-only" for="city1">City</label> <select
							class="form-control" id="city1"></select>
					</div>
					<div class="form-group">
						<label class="sr-only" for="district1">District</label> <select
							class="form-control" id="district1"></select>
					</div> -->
					<li><span class="left_tit"><span class="red pr5">*</span>详细地址</span>
						<span class="right_text"> <input type="text" value=""
							class="form-control address" id="address" name="address"
							placeholder="详细地址" data-role="none">
					</span></li>
					<!-- <li><span class="left_tit">邮政编码</span> <span
						class="right_text"> <input type="text" value=""
							class="form-control txtZipCode" id="txtZipCode" maxlength="6"
							name="txtZipCode" placeholder="邮政编码" data-role="none">
					</span></li> -->
				</ul>
				<div class="mcontainer mt15">
					<input type="button" class="btn btn-primary btn-block" id="btnSave"
						value="确定" onclick="save()" />
				</div>
				<div class="mcontainer">
					<button type="button" class="btn btn-block" onclick="goback()">返
						回</button>
				</div>
			</form>
		</div>
	</div>
	<!--添加地址e -->
</body>
<script src="<%=basePath%>views/upai/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript"
	src="<%=basePath%>views/js/bootstrap.min.js"></script>
<script type="text/javascript" src="<%=basePath%>views/js/layer.m.js"></script>
<script type="text/javascript" src="<%=basePath%>views/js/json2.js"></script>
<script type="text/javascript" src="<%=basePath%>views/js/sha1.js"></script>
<script type="text/javascript" src="<%=basePath%>views/js/CommonJS.js"></script>
<script type="text/javascript"
	src="<%=basePath%>views/js/WeiXin/WeChatJS-SDK.js"></script>
<script type="text/javascript"
	src="<%=basePath%>views/js/OrderCenter/OrderPayment.js"></script>
<script
	src="<%=basePath%>plugins/jQueryDistpicker/js/distpicker.data.js"></script>
<script src="<%=basePath%>plugins/jQueryDistpicker/js/distpicker.js"></script>
<script src="<%=basePath%>plugins/jQueryDistpicker/js/main.js"></script>
<script>
	function goback() {
		window.location.href = "../mobile/confirmCar";
	}

	function save() {
		// 有效数据验证
		if ($("#custName").val() == "") {
			layer.open({
				title : '提示',
				content : "请填写收货人"
			});
			return false;
		}
		if ($("#mobile").val() == "") {
			layer.open({
				title : '提示',
				content : "请填写手机号码"
			});
			return false;
		}
		if ($("#province1").val() == "") {
			layer.open({
				title : '提示',
				content : "请选择省份"
			});
			return false;
		}
		if ($("#city1").val() == "") {
			layer.open({
				title : '提示',
				content : "请选择城市"
			});
			return false;
		}
		if ($("#address").val() == "") {
			layer.open({
				title : '提示',
				content : "请填写详细地址"
			});
			return false;
		}
		layer.open({
			type : 2,
			content : '请稍后...'
		});

		// alert($("#address_form").serialize());
		// $("#address_form").submit();

		// var self = this;
		var sData = {};
		// // var action = "";
		// // action = "1007";
		sData.address = $("#address").val();
		sData.cmbCity = $("#city1").val();
		sData.cmbArea = $("#district1").val();
		sData.custName = $("#custName").val();
		sData.mobile = $("#mobile").val();
		sData.cmbProvince = $("#province1").val();
		// // sData.ZipCode = $(".txtZipCode").eq(1).val();
		// sData.MemberID = "";
		// sData.IsDefault = "0";
		$.ajax({
			type : "post",
			url : "../mobile/address_insertOrUpdate",
			data : sData,
			success : function(msg) {
				var info = eval('(' + msg + ')');
				if (info.code == "0000") {
					window.location.href = "../mobile/confirmCar";
				}
			}
		})
	}
</script>
</html>
